package cn.zxf.note.user.user;

import cn.zxf.note.common.jpa.AbstractEntity;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.ToString;
import lombok.experimental.Accessors;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import jakarta.persistence.Column;
import jakarta.persistence.Entity;
import jakarta.persistence.Table;

@Entity
@Table(name = "user", schema = "ENGINE=InnoDB AUTO_INCREMENT=88888")
@DynamicInsert
@DynamicUpdate
@Data
@Accessors(chain = true)
@ToString(callSuper = true)
@EqualsAndHashCode(callSuper = true)
public class User extends AbstractEntity {

    @Column(length = 20)
    private String accountNumber; // 账号
    private String mobile; // 格式：1**-****-****
    private String email;
    private String password;
    /*** 用户状态，用于判断登录 {@link UserStatusEnum} */
    private Integer status;
    /*** 用户类型 {@link UserTypeEnum} */
    private Integer type;

    public User id(Integer id) {
        super.setId(id);
        return this;
    }

}
